package fjh.Interface;

public class Warrior implements FightTablt{

    private int experience;
    private int blood;
    public Warrior()
    {
        this.experience=0;
        this.blood=100;
    }
    public Warrior(int experience,int blood)
    {
        this.experience=experience;
        this.blood=blood;
    }

    public void show()
    {
        System.out.println("战士血量值："+this.getBlood());
        System.out.println("战士经验值："+this.getExperience());
    }
    public void win() {
        System.out.println("战士取得了胜利，经验值增长了，人们都在为他欢呼！");
        this.experience=this.experience+5;
    }


    public int injure(int x) {

        System.out.println("战士受伤了，减少"+x+"血量");
        this.blood=this.blood-x;
        if(this.blood<MAX)
        {
            System.out.println("血量过低，危险***###");
        }
        if(this.blood<0)
        {
            System.out.println("战士死翘翘了~~~~");
            System.exit(1);
        }
        return x;
    }

    public int getExperience() {
        return experience;
    }

    public void setExperience(int experience) {
        this.experience = experience;
    }

    public int getBlood() {
        return blood;
    }

    public void setBlood(int blood) {
        this.blood = blood;
    }
}
